//子弹构造函数
function biu(){
	this.el = null;
	this.iTimer = null;

}
//创造
biu.prototype.create = function(){
	var 
		oBiu = createHtml('div');
	oBiu.className  = 'biu';
	document.body.appendChild(oBiu);
	if (play.iNum >= 10 ) {
		oBiu.style.width  = '20px';
		oBiu.style.height = '30px';
		oBiu.style.backgroundImage = 'url(img/biu.jpg)';

		play.reward();

		setTimeout(function(){
			play.iNum = 0;
			oBox.style.backgroundImage = "url(img/bg.jpg)";
		},10000)
	}
	oBiu.style.top  = me.el.offsetTop - oBiu.offsetHeight + 'px'; 
	oBiu.style.left = me.el.offsetLeft + me.el.offsetWidth / 2 - oBiu.offsetWidth /2 + 'px'; 
	this.el  = oBiu;

	// 将子弹存储到Engine中
	var iKey = new Date().getTime();
	play.oBius[iKey] = this;
	this.key = iKey;

	return this;
}
//发射子弹
biu.prototype.up = function(){
	this.iTimer = setInterval(function(){
		this.el.style.top = this.el.offsetTop - 40 + 'px';
		if (this.el.offsetTop < this.el.offsetHeight) {
			this.destroy();
		}
	}.bind(this),50);
}
//销毁子弹
biu.prototype.destroy = function(){
	// 将子弹从数组中移除
	delete play.oBius[this.key];
	//清除定时器
	clearInterval(this.iTimer);
	//移除DOM节点
	document.body.removeChild(this.el);
}